package com.ajhond.bingdataview.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
@Component
public interface CovidMapper {
    /**
     * echarte3_1
     * @param datetime
     * @return
     */
    @Select("select age as 'name', num as 'value' from age_num where datetime = #{datetime}")
    List<Map<String, Object>> getCovidAge(String datetime);
    /**
     * echarts3_2
     * 职业
     */
    @Select("select zhiye as 'name', num as 'value' from zy where datetime = #{datetime}")
    List<Map<String, Object>> getCovidZY(String datetime);
    /**
     * echarts3_3
     * 商品分类
     */
    @Select("select shop as 'name', num as 'value' from sp where datetime = #{datetime}")
    List<Map<String, Object>> getCovidShop(String datetime);
    /**
     * echarts2
     * INSERT INTO `bigdata`.`ptph` (`sp`, `dy`, `ks`, `jd`, `tb`, `tm`, `wph`, `pdd`)
     * @return
     */
    @Select("select sp as 'name', dy as '抖音' ,ks as '快手', jd as '京东', tb as '淘宝',tm as '天猫'," +
            " wph as '唯品会', pdd as '拼多多' from ptph")
    List<Map<String, Object>> getCovidXL();

    /**
     * map地图数据
     * @return
     * @param datetime
     */
    @Select("select name, value from mapdata where datetime = #{datetime} ")
    List<Map<String,Object>> getCovidMapdata(String datetime);

    /**
     * echarts_6
     * @param datetime
     * @return
     */
    @Select("select pt as 'name', num as 'value' from ptzb_6 where datetime = #{datetime}")
    List<Map<String, Object>> getCovidPTNum(String datetime);

    /**
     * echarts1
     * @return3
     * name as 'data1',
     */
    @Select("select  name, value from mapdata  limit 10 ")
    List<Map<String,Object>> getCovidGan();

    /**
     * echarts4
     * @return
     */
    @Select("select province, NumS, NumF from all_Province limit 10")
    List<Map<String, Object>> getCovidProvince();
    /**
     * echarts5
     * @return
     */
    @Select("select province, money from all_Province limit 10")
    List<Map<String, Object>> getCovidProvinceM();
}
